package com.yonyougov.devops.cruxcisupport.appenv;

import com.yonyougov.devops.cruxcisupport.appenv.dto.AppEnvPageDbParams;
import com.yonyougov.devops.cruxcisupport.appenv.dto.AppEnvPageLikeDbParams;
import com.yonyougov.devops.cruxcisupport.appenv.vo.AppEnvPageLikeReqVo;
import com.yonyougov.devops.cruxcisupport.appenv.vo.AppEnvPageLikeRespVo;
import com.yonyougov.devops.cruxcisupport.appenv.vo.AppEnvPageVo;
import com.yonyougov.devops.cruxcisupport.appenv.vo.AppEnvVo;
import com.yonyougov.devops.fwc.core.dao.BaseDao;

import java.math.BigInteger;
import java.util.List;

/**
 * t_app_env数据层
 */
public interface AppEnvDao extends BaseDao<AppEnvEntity, BigInteger> {
    List<AppEnvPageVo> findAllJoinBy(AppEnvPageLikeDbParams appEnvEntityVo);

    int countByJoin(AppEnvPageLikeDbParams appEnvEntityVo);

    List<AppEnvPageLikeRespVo> findPageLike(AppEnvPageLikeReqVo appEnvPageLikeReqVo);

    int countByPageLike(AppEnvPageLikeReqVo appEnvPageLikeReqVo);

    List<AppEnvPageVo> findAppEnvPageBy(AppEnvPageDbParams dbParams);

    int countByAppEnvPage(AppEnvPageDbParams dbParams);

    /**
     * 根据环境名称和应用名称查询AppEnv表
     *
     * @param envName 环境名称
     * @param appName 应用名称
     * @return AppEnvVo
     */
    AppEnvVo findByEnvNameAndAppName(String envName, String appName);

    /**
     * 批量删除
     *
     * @param ids ids
     */
    void batchDeleteById(List<BigInteger> ids);

    /**
     * 根据id查询
     *
     * @param ids ids
     * @return List<AppEnvEntity>
     */
    List<AppEnvEntity> findById(List<BigInteger> ids);
}
